package com.autonavi.yunda.yunji.core.vo.node;

import com.autonavi.yunda.yunji.common.exception.AmapPreconditions;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * SQL类型数据零部件节点
 *
 * @author ruirui.cr@alibaba-inc.com
 * @date 2023/2/13 10:12
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@EqualsAndHashCode(callSuper = true)
public class YundaSQLDataNode extends SqlNode {
    public String dataSourceName;
    public String tableName;

    @Override
    public void customParamCheck() {
        //对于SQL类型数据累部件节点，原SqlNode的dbName不再是必填项
        //AmapPreconditions.checkNotNull(dataSourceName);
        AmapPreconditions.checkNotNull(dbName);
        AmapPreconditions.checkNotNull(sql);
        AmapPreconditions.checkNotNull(tableName);
    }
}
